﻿using System;
using System.Runtime.InteropServices;

namespace Lightray.Hattrick.ChppLib.EntityTypes
{
    [ComVisible(true)]
    public abstract class EntityBase
    {
        public int ID { get; protected set; }
        public DateTime DataTime { get; protected set; }

        public override bool Equals(object other)
        {
            EntityBase otherEntity = other as EntityBase;
            if (otherEntity == null)
                return false;

            return this.ID == otherEntity.ID;
        }

        public override int GetHashCode()
        {
            return ID ^ DataTime.GetHashCode();
        }
    }

}
